/**  
* @Title: BasicSchedule.java
* @Package cn.net.mtons.core.schedule
* @Description: TODO
* @author ma jinjian  
* @date 2016年2月4日 上午12:32:06
* @version V1.0  
*/ 
package cn.net.mtons.core.schedule;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.net.mtons.core.MtonsConstant;
import cn.net.mtons.weixin.MtonsBasicBiz;

/**
 * @ClassName: BasicSchedule
 * @Description: TODO
 * @author ma jinjian
 * @date 2016年2月4日 上午12:32:06
 *
 */
@Service(value="basicSchedule")
public class BasicSchedule {
	
	private static Logger logger = Logger.getLogger("command");
	
	@SuppressWarnings("unused")
	private static Logger netLog = Logger.getLogger("netlog");
	
	@Autowired
	private MtonsBasicBiz basicBiz;
	
	public void scheduleAccessToken() {
		
		logger.info("定时获取AccessToken开始");
		
		MtonsConstant.ACCESS_TOKEN = this.basicBiz.getAccessToken();
	
		logger.info("定时获取AccessToken结束");
	}
	
	public void scheduleApiTicket(){
		logger.info("定时获取ApiTicket开始");
		
		MtonsConstant.API_TICKET = this.basicBiz.getAPITicket(MtonsConstant.ACCESS_TOKEN);
	
		logger.info("定时获取ApiTicket结束");
	}
}
